package com.explorer.ider.bootguide.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

import com.explorer.ider.bootguide.MainActivity;
import com.explorer.ider.bootguide.R;

/**
 * Created by Eric on 2017/9/19.
 */

public class FragmentZaiDian2 extends Fragment {


    private View views;
    private Button skip;
    private Context context;
    private LinearLayout linearLayout;



    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        context=getActivity();
        if (views == null){
            views = inflater.inflate(R.layout.fragment_zai_dian, container,false);
            linearLayout = (LinearLayout)views.findViewById(R.id.bg_id);
            linearLayout.setBackground(getResources().getDrawable(R.drawable.a2));
            skip = (Button)views.findViewById(R.id.complete);
            skip.setText(getResources().getString(R.string.got_it));
            skip.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    toNextPager();
                }
            });

        }
        return views;
    }


    private void toNextPager(){
        Intent intent = new Intent();
        intent.setAction(MainActivity.ACTION_TO_NEXT_PAGER7);
        getActivity().sendBroadcast(intent);

    }


}
